import os
import sys
from userdict import UserDict

class FileInfo(UserDict):
	"store file metadata"
	def __init__(self,dict=None,filename=None):
		UserDict.__init__(self,dict)
		self.data["name"] = filename

class FileInfo2(dict):
	def __init__(self,filename=None):
		self["name"] = filename;

# >>> import fileinfo
# >>> file1 = fileinfo.FileInfo()
# >>> file1.data
# {'0': 'base', 'name': None}
# >>> file1 = fileinfo.FileInfo({1:'hello'})
# >>> file1.data
# {'0': 'base', 'name': None, 1: 'hello'}
# >>> file1 = fileinfo.FileInfo({1:'hello'},'F:\\')
# >>> file1.data
# {'0': 'base', 'name': 'F:\\', 1: 'hello'}
# >>> file1
# <fileinfo.FileInfo instance at 0x021C15F8>

# >>> file2 = fileinfo.FileInfo2()
# >>> file2
# {'name': None}
# >>> file2 = fileinfo.FileInfo2("E:\\")
# >>> file2
# {'name': 'E:\\'}